# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob do
  @moduledoc """
  Represents a TuningJob that runs with Google owned models.

  ## Attributes

  *   `baseModel` (*type:* `String.t`, *default:* `nil`) - The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the TuningJob was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. The description of the TuningJob.
  *   `encryptionSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t`, *default:* `nil`) - Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
  *   `error` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
  *   `experiment` (*type:* `String.t`, *default:* `nil`) - Output only. The Experiment associated with this TuningJob.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The detailed state of the job.
  *   `supervisedTuningSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SupervisedTuningSpec.t`, *default:* `nil`) - Tuning Spec for Supervised Fine Tuning.
  *   `tunedModel` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TunedModel.t`, *default:* `nil`) - Output only. The tuned model resources associated with this TuningJob.
  *   `tunedModelDisplayName` (*type:* `String.t`, *default:* `nil`) - Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  *   `tuningDataStats` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningDataStats.t`, *default:* `nil`) - Output only. The tuning data statistics associated with this TuningJob.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the TuningJob was most recently updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :baseModel => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :encryptionSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t() | nil,
          :endTime => DateTime.t() | nil,
          :error => GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t() | nil,
          :experiment => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :serviceAccount => String.t() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :supervisedTuningSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SupervisedTuningSpec.t() | nil,
          :tunedModel =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TunedModel.t() | nil,
          :tunedModelDisplayName => String.t() | nil,
          :tuningDataStats =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningDataStats.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:baseModel)
  field(:createTime, as: DateTime)
  field(:description)
  field(:encryptionSpec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec)
  field(:endTime, as: DateTime)
  field(:error, as: GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus)
  field(:experiment)
  field(:labels, type: :map)
  field(:name)
  field(:serviceAccount)
  field(:startTime, as: DateTime)
  field(:state)

  field(:supervisedTuningSpec,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SupervisedTuningSpec
  )

  field(:tunedModel, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TunedModel)
  field(:tunedModelDisplayName)

  field(:tuningDataStats, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningDataStats)

  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TuningJob do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
